package gmu.drr.entity;

import java.util.ArrayList;

public abstract class DocGroupRelModel {

	private int docInd;
	private long docNo;
	private Doc doc;
	private boolean isActive;
	protected static ArrayList<DocGroupRelModel> allActive = null;
	
	public boolean isActive() {
		return isActive;
	}

	public void setActive(boolean isActive) {
		if( isActive != this.isActive ) {
			if( isActive ) allActive.add(this.docInd, this);
			else allActive.remove(this.docInd);
		}
		this.isActive = isActive;
	}


	public int getDocInd() {
		return docInd;
	}

	public void setDocInd(int docInd) {
		this.docInd = docInd;
	}

	public long getDocNo() {
		return docNo;
	}

	public void setDocNo(long docNo) {
		this.docNo = docNo;
	}


	public Doc getDoc() {
		return doc;
	}

	public void setDoc(Doc doc) {
		this.doc = doc;
		this.docNo = doc.getDocNo();
		this.docInd = doc.getContextInd();
	}

	/* end getters and setters */
	
	/** subclass responsibility */
	abstract public Doc getInverseDoc( DocGroup group );

	public DocGroupRelModel() {
		super();
		if(allActive == null) allActive = new ArrayList<DocGroupRelModel>();
	}
	
	
}
